<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
UpdatingMultipleLinearRegression (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="UpdatingMultipleLinearRegression (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/UpdatingMultipleLinearRegression.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/regression/SimpleRegression.html" title="class in org.apache.commons.math3.stat.regression"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="UpdatingMultipleLinearRegression.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.stat.regression</FONT>
<BR>
Interface UpdatingMultipleLinearRegression</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../../org/apache/commons/math3/stat/regression/MillerUpdatingRegression.html" title="class in org.apache.commons.math3.stat.regression">MillerUpdatingRegression</A>, <A HREF="../../../../../../org/apache/commons/math3/stat/regression/SimpleRegression.html" title="class in org.apache.commons.math3.stat.regression">SimpleRegression</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>UpdatingMultipleLinearRegression</B></DL>
</PRE>

<P>
An interface for regression models allowing for dynamic updating of the data.
 That is, the entire data set need not be loaded into memory. As observations
 become available, they can be added to the regression  model and an updated
 estimate regression statistics can be calculated.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>3.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: UpdatingMultipleLinearRegression.java 1392342 2012-10-01 14:08:52Z psteitz $</DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#addObservation(double[], double)">addObservation</A></B>(double[]&nbsp;x,
               double&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds one observation to the regression model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#addObservations(double[][], double[])">addObservations</A></B>(double[][]&nbsp;x,
                double[]&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a series of observations to the regression model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#clear()">clear</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clears internal buffers and resets the regression model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#getN()">getN</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of observations added to the regression model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#hasIntercept()">hasIntercept</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if a constant has been included false otherwise.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/regression/RegressionResults.html" title="class in org.apache.commons.math3.stat.regression">RegressionResults</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#regress()">regress</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs a regression on data present in buffers and outputs a RegressionResults object</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/regression/RegressionResults.html" title="class in org.apache.commons.math3.stat.regression">RegressionResults</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html#regress(int[])">regress</A></B>(int[]&nbsp;variablesToInclude)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs a regression on data present in buffers including only regressors
 indexed in variablesToInclude and outputs a RegressionResults object</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="hasIntercept()"><!-- --></A><H3>
hasIntercept</H3>
<PRE>
boolean <B>hasIntercept</B>()</PRE>
<DL>
<DD>Returns true if a constant has been included false otherwise.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>true if constant exists, false otherwise</DL>
</DD>
</DL>
<HR>

<A NAME="getN()"><!-- --></A><H3>
getN</H3>
<PRE>
long <B>getN</B>()</PRE>
<DL>
<DD>Returns the number of observations added to the regression model.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>Number of observations</DL>
</DD>
</DL>
<HR>

<A NAME="addObservation(double[], double)"><!-- --></A><H3>
addObservation</H3>
<PRE>
void <B>addObservation</B>(double[]&nbsp;x,
                    double&nbsp;y)
                    throws <A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A></PRE>
<DL>
<DD>Adds one observation to the regression model.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the independent variables which form the design matrix<DD><CODE>y</CODE> - the dependent or response variable
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A></CODE> - if the length of <code>x</code> does not equal
 the number of independent variables in the model</DL>
</DD>
</DL>
<HR>

<A NAME="addObservations(double[][], double[])"><!-- --></A><H3>
addObservations</H3>
<PRE>
void <B>addObservations</B>(double[][]&nbsp;x,
                     double[]&nbsp;y)
                     throws <A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A></PRE>
<DL>
<DD>Adds a series of observations to the regression model. The lengths of
 x and y must be the same and x must be rectangular.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - a series of observations on the independent variables<DD><CODE>y</CODE> - a series of observations on the dependent variable
 The length of x and y must be the same
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A></CODE> - if <code>x</code> is not rectangular, does not match
 the length of <code>y</code> or does not contain sufficient data to estimate the model</DL>
</DD>
</DL>
<HR>

<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
void <B>clear</B>()</PRE>
<DL>
<DD>Clears internal buffers and resets the regression model. This means all
 data and derived values are initialized
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="regress()"><!-- --></A><H3>
regress</H3>
<PRE>
<A HREF="../../../../../../org/apache/commons/math3/stat/regression/RegressionResults.html" title="class in org.apache.commons.math3.stat.regression">RegressionResults</A> <B>regress</B>()
                          throws <A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A>,
                                 <A HREF="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</A></PRE>
<DL>
<DD>Performs a regression on data present in buffers and outputs a RegressionResults object
<P>
<DD><DL>

<DT><B>Returns:</B><DD>RegressionResults acts as a container of regression output
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A></CODE> - if the model is not correctly specified
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</A></CODE> - if there is not sufficient data in the model to
 estimate the regression parameters</DL>
</DD>
</DL>
<HR>

<A NAME="regress(int[])"><!-- --></A><H3>
regress</H3>
<PRE>
<A HREF="../../../../../../org/apache/commons/math3/stat/regression/RegressionResults.html" title="class in org.apache.commons.math3.stat.regression">RegressionResults</A> <B>regress</B>(int[]&nbsp;variablesToInclude)
                          throws <A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A>,
                                 <A HREF="../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A></PRE>
<DL>
<DD>Performs a regression on data present in buffers including only regressors
 indexed in variablesToInclude and outputs a RegressionResults object
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>variablesToInclude</CODE> - an array of indices of regressors to include
<DT><B>Returns:</B><DD>RegressionResults acts as a container of regression output
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/stat/regression/ModelSpecificationException.html" title="class in org.apache.commons.math3.stat.regression">ModelSpecificationException</A></CODE> - if the model is not correctly specified
<DD><CODE><A HREF="../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A></CODE> - if the variablesToInclude array is null or zero length</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/UpdatingMultipleLinearRegression.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/stat/regression/SimpleRegression.html" title="class in org.apache.commons.math3.stat.regression"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/stat/regression/UpdatingMultipleLinearRegression.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="UpdatingMultipleLinearRegression.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
